<template>
    <div>
<h2>基本信息</h2>
<table>
    <tr>
        <td>姓名:</td>
        <td>{{ name }}</td>
    </tr>
    <tr>
        <td>电话:</td>
        <td>{{ phone }}</td>
    </tr>
    <tr>
        <td>性别:</td>
        <td>{{sex  }}</td>
    </tr>
    <tr>
        <td>生日:</td>
        <td>{{ Birthday }}</td>
    </tr>
</table>
    </div>
</template>

<script setup lang="ts">
import { onMounted, reactive, toRefs } from 'vue';
import axios from 'axios';
import { useRouter, useRoute } from 'vue-router';
const router = useRouter();
const route = useRoute();
let data:any = reactive({
   
        phone: "",
        name: "",
        sex:"",
        Birthday:""
 
})
let { phone,name,sex,Birthday } = toRefs(data)
onMounted(()=>{
    getlist()
})
const getlist=()=>{
    let obj = {
       id:route.query.id
    }
    axios({
        url: '/api/Member/GetMember',
        method: 'get',
        params: obj
    })
        .then(res => {
            console.log(res)
            name.value=res.data.data.userName
            phone.value=res.data.data.phone
            sex.value=res.data.data.sex
            Birthday.value=res.data.data.birthDay

        })
        .catch(err => {
            console.log(err)
        })
}
</script>

<style scoped>

</style>